package com.InvoicingSystem.service.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;

import com.InvoicingSystem.dao.ProductMapper;
import com.InvoicingSystem.pojo.Product;
import com.InvoicingSystem.service.ProductServices;
import com.InvoicingSystem.util.MyBatisUtil;

@Service
public class ProductServicesImpl implements ProductServices {
	// 在springmvc注册service则不需要实例化调用service的类
	@Override
	public List<Product> findAll() {
		SqlSession session = MyBatisUtil.getSession();
		ProductMapper productMapper = session.getMapper(ProductMapper.class);

		List<Product> list = productMapper.findAll();

		

		return list;
	}

}
